package com.hhkj.admin.bank.controller;

import com.hhkj.admin.bank.domain.BankRule;
import com.hhkj.admin.bank.model.req.BankRuleReq;
import com.hhkj.admin.bank.model.res.BankRuleRes;
import com.hhkj.admin.bank.service.biz.BankRuleBizService;
import com.ruoyi.common.annotation.LogTitlePrefix;
import com.ruoyi.common.annotation.PermissionPrefix;
import com.ruoyi.common.base.biz.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 题库抽题规则Controller
 *
 * @author ruoyi
 * @since 2023-05-11
 */
@LogTitlePrefix("题库选题规则")
@PermissionPrefix("train:bankRule")
@RestController
@RequestMapping("/bank/rule")
public class BankRuleController extends BaseController<BankRule, BankRuleReq, BankRuleRes, BankRuleBizService>
{

    /**
     * 获取题库抽题规则详细信息
     */
    @PreAuthorize("@ss.hasPermi(this, 'query')")
    @PostMapping("/detail")
    public AjaxResult detail(@RequestBody BankRuleReq req)
    {
        return AjaxResult.successData(this.getBizService().getByCourseParentIdAndCourseBankTypeId(req.getCourseParentId(), req.getCourseBankTypeId()));
    }
}
